(function () {
    $('#form').validate({
        rules:{
            mobile:{
                required:true
                ,mobile:true
            }
            ,password:{
                required:true
                ,rangelength:[6,15]
            }
            ,validate:{
                required:true
                ,minlength:5
                ,maxlength:5
            }

        },
        submitHandler:function (form) {
            layer.load(2);
            $.post(DURL+'/is_login',$(form).serialize(),function (da) {
                $('.captcha img').click();
                if(da == 1){
                    location.href=DUSER+'/index.html'
                }
                else if(da == 2){
                    layer.closeAll();
                    layer.msg('验证码错误',{icon:2});
                }
                else{
                    layer.closeAll();
                    layer.msg('登入失败',{icon:2});
                }
            });
        }
    });


})();